<template>
    <view class="paidList">
        <view class="item">
            <view class="bookInfo">
                <u--image height="6rem" width="6rem" :src="paidItem.bookLink"></u--image>
                <view class="midInfo">
                    <view class="title">{{ paidItem.title }}</view>
                    <view class="author">作者：{{ paidItem.author }}</view>
                </view>
                <view class="bookState">
                    已发货
                </view>
            </view>
            <view class="logisticsStatus">
                <view v-if="paidItem.logisticsStatus.isSend == true">
                    <i class="iconfont icon-yifahuo"></i>
                    <span>已发货</span>
                    <span class="status">{{ paidItem.logisticsStatus.status }}</span>
                </view>
                <view v-if="paidItem.logisticsStatus.isLanShou == true">
                    <i class="iconfont icon-lanshou"></i>
                    <span>已揽收</span>
                    <span class="status">{{ paidItem.logisticsStatus.status }}</span>
                </view>
                <view v-if="paidItem.logisticsStatus.isSend == false">
                    <i class="iconfont icon-weifahuo"></i>
                    <span>待发货</span>
                    <span class="status">{{ paidItem.logisticsStatus.status }}</span>
                </view>
                <view v-if="paidItem.logisticsStatus.isQiansho == true">
                    <i class="iconfont icon-qianshou"></i>
                    <span>已签收</span>
                    <span class="status">{{ paidItem.logisticsStatus.status }}</span>
                </view>
            </view>
            <view class="price">实付款￥{{ paidItem.price }}</view>
            <view class="operate">
                <view class="right">
                    <u-button class="btn" type="primary" size="small" @click="updateAddress">查看物流
                    </u-button>
                    <u-button class="btn pay" type="primary" size="small" @click="confirmGoods">确认收货</u-button>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    name: 'paidList',
    props: {
        paidItem: {
            type: Object,
            default: () => {}
        }
    },
    methods:{
        updateAddress() {
            console.log('修改地址')
        },
        confirmGoods() {
            console.log('确认收货')
        }
    }

}
</script>

<style lang="scss">
.paidList {
    width: 100%;
    margin-bottom: 1rem;

    .item {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        background: white;
        border-radius: 1rem;
        padding: 0.5rem;
        // margin: 1rem 0;

        .bookInfo {
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            width: 100%;

            .midInfo {
                margin-left: 1rem;

                .title {
                    font-size: 1.2rem;
                    font-weight: bold;
                    color: #333;
                }

                .author {
                    font-size: 0.8rem;
                    color: #999;
                }
            }

            .bookState {
                position: absolute;
                right: 1rem;
            }
        }

        .closeTime {
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            background: $uni-color-theme-1;
            color: $uni-color-theme-9;
            padding: 0.5rem 1.5rem;
            border-radius: 0.5rem;
            margin: 0.5rem 0;
            margin-left: 1rem;

            .countDown {
                padding-right: 0.5rem;
            }

        }

        .logisticsStatus {
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            background: $uni-color-theme-1;
            color: rgb(53, 53, 53);
            padding: 0.5rem 1.5rem;
            border-radius: 0.5rem;
            margin: 0.5rem 0;
            margin-left: 1rem;
            font-weight: bold;
            overflow: hidden;
            width: 18rem;
            white-space: nowrap;

            i {
                margin-right: 0.5rem;
                font-size: 1.2rem;

            }

            .status {
                display: inline-block;
                margin-left: 0.5rem;
                line-height: 1rem;
                font-size: 0.6rem;
            }
        }

        .price {
            width: 90%;
            text-align: end;
        }

        .operate {
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            // align-items: center;
            width: 100%;
            margin-top: 0.5rem;

            .btn {
                width: 6rem;
                height: 2rem;
                border: none;
                background: transparent;
                color: #333;
                font-size: 0.8rem;
                text-align: center;
                line-height: 1.5rem;
                font-size: 1rem;
                margin: 0 0.5rem;
            }

            .closeOrder {
                margin-right: 3rem;
                font-size: 0.8rem;
                color: $uni-text-color-grey;
            }

            .right {
                display: flex;
                flex-direction: row;

                .btn {
                    border-radius: 1rem;
                    border: 1px solid $uni-text-color-grey;
                    color: $uni-text-color-grey;
                }

                .pay {
                    border-radius: 1rem;
                    border: 1px solid $uni-color-theme-6;
                    color: $uni-color-theme-6;
                }

            }
        }
    }
}
</style>